import 'package:googleapis_auth/auth_io.dart';

part 'environment.dart';

class Config {
  factory Config() {
    return _instance;
  }

  Config._internal();

  static final _instance = Config._internal();

  late final Environment environment;
  late final String mongodbHost;
  late final int mongodbPort;
  late final String mongodbDbName;
  late final String apiAccessTokenSecretKey;
  late final String noreplyEmailBoxPassword;
  late final bool userEmailSendingEnabled;
  late final String yookassaMerchantId;
  late final String yookassaSecretKey;
  late final ServiceAccountCredentials googleServiceAccountCredentials;
  late final String appStoreSharedSecret;
  late final String appStoreApiKeyId;
  late final String amplitudeApiKey;

  final yookassaApiBaseUrl = 'https://api.yookassa.ru/v3';

  void init({
    required Environment environment,
    required String mongodbHost,
    required int mongodbPort,
    required String mongodbDbName,
    required String apiAccessTokenSecretKey,
    required String noreplyEmailBoxPassword,
    required bool userEmailSendingEnabled,
    required String yookassaMerchantId,
    required String yookassaSecretKey,
    required ServiceAccountCredentials googleServiceAccountCredentials,
    required String appStoreSharedSecret,
    required String appStoreApiKeyId,
    required String amplitudeApiKey,
  }) {
    this.environment = environment;
    this.mongodbHost = mongodbHost;
    this.mongodbPort = mongodbPort;
    this.mongodbDbName = mongodbDbName;
    this.apiAccessTokenSecretKey = apiAccessTokenSecretKey;
    this.noreplyEmailBoxPassword = noreplyEmailBoxPassword;
    this.userEmailSendingEnabled = userEmailSendingEnabled;
    this.yookassaMerchantId = yookassaMerchantId;
    this.yookassaSecretKey = yookassaSecretKey;
    this.googleServiceAccountCredentials = googleServiceAccountCredentials;
    this.appStoreSharedSecret = appStoreSharedSecret;
    this.appStoreApiKeyId = appStoreApiKeyId;
    this.amplitudeApiKey = amplitudeApiKey;
  }
}
